﻿@using CQRS.Sales.Interfaces.Presentation
@model ClientOrderDetailsDto


<h2>Confir order</h2>

<h2>ordered items</h2>
<table class="ordersTable">
	<thead>
		<tr>
			<td class="productsColumn">product</td>
			<td class="quantityColumn">quantity</td>
			<td class="costColumn">price</td>
		</tr>
	</thead>
	<tbody>
    @foreach (var order in Model.OrderedProducts)
    {
        <tr>
				<td class="productsColumn">@order.Name
				</td>
				<td class="quantityColumn">@order.Quantity</td>
				<td class="costColumn">@order.EffectiveCost</td>
			</tr>
    }
					
	</tbody>
	<tfoot>
		<tr>
			<td colspan="2" style="text-align: right; padding-right: 10px;">total
				cost:</td>
			<td>@Model.TotalCost
			</td>
		</tr>
	</tfoot>
</table>
<div>
	Order status: <span class="orderConfirmationStatus">@Model.OrderStatus</span>
</div>
<div class="orderConfirmationControls">
	<div class="inline">are you sure that you want to confirm this
		order?</div>
        @using (Html.BeginForm("Confirm", "Cart", FormMethod.Post))
        {
            @Html.Hidden("orderId", Model.OrderId)
            <input type="submit" value="Confirm" />
        }
</div>